<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>容器日志</title>
    <link rel="stylesheet" type="text/css" href="../../js/layer/css/layui.css">
</head>
<body>
<div style="width: 100%; text-align: right; position: fixed; bottom: 10px;"><a href="javascript:void(0)" onclick="resetlog(this)">清空&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></div>

<pre id="precode">

</pre>
<script src="../../js/layer/layui.js"></script>
<script>
    ready(function() {
        layui.use(['zhanshop'], function() {
            var zhanshop = layui.zhanshop;
            submitData = {
                "_method": "log",
            };
            zhanshop.ajax(API_ADDRESS+apiUrlTable+'/Cloudapp?id='+zhanshop.getParam("id"), 'POST', submitData, {}, function(res){
                document.getElementById('precode').innerHTML += res.data.log;
            },function(xhr){
                return layui.zhanshop.alert(xhr.responseJSON.msg ? xhr.responseJSON.msg : xhr.statusText, 'danger');
            }, true, apiFromJson);


            window.resetlog = function () {
                submitData = {
                    "_method": "resetlog",
                };
                zhanshop.ajax(API_ADDRESS+apiUrlTable+'/Cloudapp?id='+zhanshop.getParam("id"), 'POST', submitData, {}, function(res){
                    window.location.reload();
                },function(xhr){
                    return layui.zhanshop.alert(xhr.responseJSON.msg ? xhr.responseJSON.msg : xhr.statusText, 'danger');
                }, true, apiFromJson);
            }

        });
    });

</script>
</body>
</html>